﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using YKhoa_Lib.DAL;

namespace YKhoa_Lib.BLL
{
    
    public class So_ChiDinh
    {
        private DAL_ChiDinh dal_ChiDinh;
        public string MaPhieu { get; set; }
        public string MaPhieuKham { get; set; }
        public DateTime Ngay { get; set; }
        public string MaBN { get; set; }
        public int DoiTuong { get; set; }
        public string MaNV { get; set; }
        public string NguoiChiDinh { get; set; }
        public string NoiChiDinh { get; set; }
        public double TongTien { get; set; }
        public bool DaSuDung { get; set; }
        public string MaDotKham { get; set; }
        public Int16 UuTien { get; set; }
        public List<ChiTiet_ChiDinh> ChiTietChiDinhs { get; set; }
        public So_ChiDinh()
        {
            dal_ChiDinh = new DAL_ChiDinh();
            ChiTietChiDinhs = new List<ChiTiet_ChiDinh>();
        }

        #region Tạm thời không dùng
        public string TaoMaPhieuMoi()
        {
            return dal_ChiDinh.TaoMaPhieuMoi();       
        }
        #endregion

        public bool LuuChiDinh()
        {
            return dal_ChiDinh.LuuChiDinh(this);
        }

        public bool CapNhatChiDinh()
        {
            return dal_ChiDinh.CapNhatChiDinh(this);
        }

        public bool KiemTraMaDotKham()
        {
            return dal_ChiDinh.KiemTraDotKham(MaBN, MaDotKham);
        }

        public bool KiemTraSuDung()
        {
            return dal_ChiDinh.KiemTraSuDung(MaPhieu);
        }
    }
}